﻿

namespace Huirui.Cavan.Core.Extension
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.Contracts;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    using Huirui.Cavan.Core.Storage;

    public static partial class Ext
    {
        #region Cache
        static readonly CacheStorage CacheStorage = new CacheStorage();

        public static ICacheStorage Cache()
        {
            return CacheStorage;
        }
        #endregion Cache

        #region Session
        public static ISessionStorage Session(this ControllerContext context)
        {
            return new SessionStorage
            {
                HttpContextBase = context.HttpContext,
            };
        }

        public static ISessionStorage Session(this HttpContext context)
        {
            return new SessionStorage
            {
                HttpContext = context,
            };
        }
        #endregion Session
    }
}